/*
 * @Author: wangjing 1173862626@qq.com
 * @Date: 2025-05-26 10:36:58
 * @LastEditors: wangjing 1173862626@qq.com
 * @LastEditTime:2025-05-26 10:36:58
 * @FilePath: \neilao-mobile\src\api\riskIdentify.ts
 * @Description: 辨识预警接口-巡查工单、养护工单、小修工单
 */
import { http } from '@/utils/request'
const { VITE_BASE_IDENTIFY_PROXY } = import.meta.env

// 图片上传
export const upload = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/file/upload`, data, {
    tokenType: 'identification'
  })
}

// 获取巡查工单列表 /work_inspection/getPointList
export const getPatrolPage = (params) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/mobile/page`, {
    params,
    tokenType: 'identification'
  })
}

// 获取工单详情的-点位列表信息
export const getPatrolPointList = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/mobile/point_list`, data, {
    tokenType: 'identification'
  })
}

// 获取工单详情的 - 巡查工单
export const getPatrolWorkDetail = (id) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/detail/${id}`, {},{
    tokenType: 'identification'
  })
}

// 获取工单详情的-点位信息
export const getPatrolPointDetail = (workId) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/inspection_issue/list/${workId}`, {}, {
    tokenType: 'identification'
  })
}

// 巡查工单-问题上报
export const addPointProblem = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/inspection_issue/addIssue`, data, {
    tokenType: 'identification'
  })
}

// 巡查工单-巡查上报
export const addPointReport = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/inspection_report/addReport`, data, {
    tokenType: 'identification'
  })
}
// 巡查工单-工单办结
export const patrolDoneWork = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/mobile/done_work`, data, {
    tokenType: 'identification'
  })
}

// 养护工单 - 获取工单详情的
export const getMaintainWorkDetail = (id) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/maintenance/detail/${id}`, {},{
    tokenType: 'identification'
  })
}

// 养护工单 - 养护上报
export const addPointReportMaintenance = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/inspection_report/report_maintenance`, data, {
    tokenType: 'identification'
  })
}

// 养护工单-工单办结
export const maintenanceDoneWork = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/work_inspection/mobile/done_maintenance_work`, data, {
    tokenType: 'identification'
  })
}

// 获取小修工单列表 
export const getRepairPage = (params) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/mini_repair/mobile/page`, {
    params,
    tokenType: 'identification'
  })
}

// 小修工单 - 获取工单详情的
export const getRepairWorkDetail = (id) => {
  return http.get(`${VITE_BASE_IDENTIFY_PROXY}/mini_repair/detail/${id}`, {},{
    tokenType: 'identification'
  })
}

// 小修工单 - 办结
export const repairDoneWork = (data) => {
  return http.post(`${VITE_BASE_IDENTIFY_PROXY}/mini_repair/done`, data, {
    tokenType: 'identification'
  })
}